<#assign packageModel=projPackage.projPackage valuePrefix="#{"
        daoPackage=projPackage.projPackage + "." + projPackage.dao
        modelFullPackage=projPackage.projPackage + "." + projPackage.entity + "." +tableInfo.modelClassName
        utilsFullPackage=projPackage.projPackage + "." + projPackage.utils
        >
package ${daoPackage};

import org.springframework.stereotype.Repository;
import java.util.List;
import ${modelFullPackage};
import ${utilsFullPackage}.Example;
import org.apache.ibatis.annotations.Param;

/**
 * 版本号：20240401
 * @Description : 由代码生成器生成
 * @Author : chanchaw
 * @Date :  ${.now?date} ${.now?time}
 */
@Repository
public interface ${tableInfo.modelClassName}Mapper {
    int insert(${tableInfo.modelClassName} record);

    int insertSelective(${tableInfo.modelClassName} record);

    int multiInsert(List<${tableInfo.modelClassName}> list);

    int updateByPrimaryKey(${tableInfo.modelClassName} record);

    int updateByPrimaryKeySelective(${tableInfo.modelClassName} record);

    <#list tableInfo.fieldInfoList as field>
    <#if field.primaryKey=true>
    // 根据主键删除
    int deleteByPrimaryKey(${field.javaType} ${field.fieldName});
    // 根据主键查询
    ${tableInfo.modelClassName} selectByPrimaryKey(${field.javaType} ${field.fieldName});
    </#if>
    </#list>

    List<${tableInfo.modelClassName}> selectAll();

    int save(${tableInfo.modelClassName} record);
    int multiSave(List<${tableInfo.modelClassName}> list);

    //================= 下面是 Example 代码 ==================
    List<${tableInfo.modelClassName}> selectByExample(@Param("example") Example example);
    int updateByExampleSelective(@Param("record") ${tableInfo.modelClassName} record,@Param("example") Example example);
    int insertByExampleSelective(@Param("record") ${tableInfo.modelClassName} record,@Param("example") Example example);
    int deleteByExample(@Param("example") Example example);

    ${tableInfo.modelClassName} getNext(${tableInfo.pkFieldJavaType} id);
    ${tableInfo.modelClassName} getPrev(${tableInfo.pkFieldJavaType} id);
    ${tableInfo.modelClassName} getFirst();
    ${tableInfo.modelClassName} getLast();
    //=================以上是自动生成的代码，自定义代码请写在下面==================
}